package org.example.liushichuanshu;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

public class ClientHandler extends SimpleChannelInboundHandler<String> {

    @Override
    protected void channelRead0(ChannelHandlerContext context, String msg) throws Exception {
        System.out.println("服务器的ip: " + context.channel().remoteAddress() + ",服务器发送到客户端的消息：" + msg);
    }

    @Override
    public void channelActive(ChannelHandlerContext context) {
        context.writeAndFlush("abcdefghijklmn");
    }
}
